#-------------------------------------------------------------------------------
# Name:        utils
# Purpose:     Provides some useful (mainly system) functions
#
# Author:      Bc. Ondrej Pelikan
#
# Created:     05.04.2013
#-------------------------------------------------------------------------------

import os, inspect, sys

def addDirToSysPath(relativePath):
    """ Adds relativePath to the sys.path. Python import command then searching also in relativePath.
        It is used mainly for adding parent folder of a certain python package. Then it is possible to import the package"""
    path = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0], relativePath)))
    if path not in sys.path:
        sys.path.insert(0, path)